Skip to content

Conversation

@imantsk
Copy link
Member

@imantsk imantsk commented Nov 4, 2025

  • fixed styling and functionality for "Share with subsites" toggle in snippet editor
  • fixed Shared snippets to appear in subsite snippets lists with individual activate/deactivate capability
  • imporved visual indicators:
    • Network admin: Dashicons networking icon with "Shared with subsites" native tooltip
    • Subsites: Activation switches for shared snippets (instead of "Network Active" label)

@imantsk imantsk changed the base branch from core to core-beta November 4, 2025 16:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the handling of shared network snippets in a WordPress multisite environment. The changes improve how shared network snippets are fetched, displayed, and managed across both the REST API and the admin list table interface.

  • Standardized the logic for retrieving and marking shared network snippets
  • Updated the UI to display a networking icon instead of a text badge for shared snippets
  • Enhanced the multisite sharing settings component with improved styling and accessibility

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/php/rest-api/class-snippets-rest-controller.php Added get_network_items() method to merge shared network snippets into REST API responses
src/php/class-list-table.php Refactored fetch_shared_network_snippets() to return modified array, replaced text badge with icon in activation column
src/js/utils/snippets/api.ts Added shared_network field to API mapping
src/js/components/EditorSidebar/controls/MultisiteSharingSettings.tsx Improved UI with Tooltip component and better label structure
src/css/common/_badges.scss Added styles for .network-shared icon, removed line-height from .badge

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
*
* @return array<Snippet> Modified list of snippets.
*/
private function get_network_items( array $all_snippets, $network ): array {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can think about the method name. It does not just "get_network_items" :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you have any good suggestion? get_network_snippets maybe?

@louiswol94
Copy link
Contributor

@imantsk It might be worth to try and get Playwright tests running on multisite as well. And then write a test for this case.

@imantsk
Copy link
Member Author

imantsk commented Nov 8, 2025

@imantsk It might be worth to try and get Playwright tests running on multisite as well. And then write a test for this case.

Very good point @louiswol94! However, since this is quite a substantial task, we will address it in a separate issue: #292

@imantsk imantsk merged commit 1a89a7f into core-beta Nov 10, 2025
9 checks passed
@imantsk imantsk deleted the fix/share-with-subsites branch November 10, 2025 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants